package com.vhall.component.controller.rbac.facade;

import com.vhall.component.entity.rbac.vo.*;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

/**
 * 角色的权限操作
 *
 * @author longzhen.gong
 * @date 2021/6/10 18:24
 */
@FeignClient(name = "RbacRoleFacade", path = "/v4/rbac/role/")
public interface RbacRoleFacade {

    /**
     * 增加角色权限
     *
     * @param reqVO 参数
     * @return 返回值
     */
    @ApiOperation("增加角色权限")
    @PostMapping(value = "add-access")
    Boolean addAccess(@Validated RoleAddAccessReqVO reqVO);

    /**
     * 删除角色权限
     *
     * @param reqVO 参数
     * @return 返回值
     */
    @ApiOperation("删除角色权限")
    @PostMapping(value = "delete-access")
    Boolean deleteAccess(@Validated RoleDeleteAccessReqVO reqVO);

    /**
     * 获取应用角色列表
     *
     * @param reqVO 参数
     * @return 返回值
     */
    @ApiOperation("获取应用角色列表")
    @GetMapping(value = "get-list-by-app")
    List<RoleVO> getListByApp(@Validated RoleGetListByAppReqVO reqVO);

    /**
     * 修改角色
     *
     * @param reqVO 参数
     * @return 返回值
     */
    @ApiOperation("修改角色")
    @PostMapping(value = "update")
    Boolean update(@Validated RoleUpdateReqVO reqVO);

    /**
     * 创建角色
     *
     * @param reqVO 参数
     * @return 返回值
     */
    @ApiOperation("创建角色")
    @PostMapping(value = "create")
    RoleVO create(@Validated RoleCreateReqVO reqVO);

    /**
     * 删除角色
     *
     * @param reqVO 参数
     * @return 返回值
     */
    @ApiOperation("删除角色")
    @PostMapping(value = "delete")
    Boolean delete(@Validated RoleDeleteReqVO reqVO);

    /**
     * 获取角色权限
     *
     * @param reqVO 参数
     * @return 返回值
     */
    @ApiOperation("获取角色权限")
    @GetMapping(value = "info")
    List<RoleInfoRspVO> info(@Validated RoleInfoReqVO reqVO);

    /**
     * 角色-编辑菜单权限
     *
     * @return 返回值
     */
    @ApiOperation("角色-编辑菜单权限")
    @PostMapping(value = "edit-menues")
    Boolean editMenues(@Validated EditMenuesReqVO vo);

}
